<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.Statement" %><%--
  Created by IntelliJ IDEA.
  User: zhu
  Date: 2018/5/27
  Time: 0:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="refresh" content="1;URL=http://localhost:8080/test01.jsp" >

    <meta http-equiv="Content-Type" content="text/css" charset="UTF-8">
</head>
<body>
更新已完成，正在跳转中
<%
    Connection connection = null;
    Statement statement = null;

    request.setCharacterEncoding("utf-8");
    String id = request.getParameter("id");
    String sql = "DELETE FROM t_users WHERE id = "+ id;

    Class.forName("com.mysql.jdbc.Driver");
    connection = DriverManager.getConnection(
            "jdbc:mysql://localhost:3306/sctu-javaweb-2018?serverTimezone=UTC",
            "root",
            "123456"
    );

    statement = connection.createStatement();
    Boolean resultSet = statement.execute(sql);

    statement.close();
    connection.close();
%>
</body>
</html>
